<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<!--[if IE 8]>
<html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]>
<html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js"> <!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>管理员 - {$Config.sitename}</title>
    <meta content="width=device-width, initial-scale=1.0" name="viewport"/>
    <meta content="" name="description"/>
    <meta content="" name="author"/>
    <include file="Public:meta"/>
    <link rel="stylesheet" type="text/css" href="__TMPL__Public/plugins/data-tables/DT_bootstrap.css"/>
    <link rel="shortcut icon" href="favicon.ico"/>
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
<include file="Public:header"/>
<!-- BEGIN CONTAINER -->
<div class="page-container">
    <include file="Public:sidebar"/>
    <!-- BEGIN PAGE -->
    <div class="page-content">
        <!-- BEGIN PAGE CONTAINER-->
        <div class="container-fluid">
            <!-- BEGIN PAGE HEADER-->
            <div class="row-fluid">
                 <!-- begin BCN -->
                <div class="row-fluid">
                    <div class="span12"><ul class="breadcrumb"><li><i class="icon-home"></i><a onfocus="blurLink(this);" href="{:U('Index/index')}">首页</a>&nbsp;<span class="icon-angle-right"></span>&nbsp;</li><li><a onfocus="blurLink(this);" href="{:U(CONTROLLER_NAME . '/index', 'kept=1')}">{$ParentPageName|default="未命名"}</a>&nbsp;<span class="icon-angle-right"></span>&nbsp;</li><li>{$PageName|default="未命名"}</li></ul></div>
                </div>
                <!-- end BCN -->
            </div>
            <!-- END PAGE HEADER-->
            <!-- BEGIN PAGE CONTENT-->
            <div class="row-fluid profile">
                <div class="span12">
                    <form action="" class="form-horizontal" enctype="multipart/form-data" method="post">
                        <!--BEGIN TABS-->
                        <div class="tabbable tabbable-custom tabbable-full-width">
                            <ul class="nav nav-tabs">
                                <!-- (标记)20160118 权限修复 -->
                                <if condition="checkAccess(CONTROLLER_NAME, 'user_save') OR checkAccess(CONTROLLER_NAME, 'user_edit')">
                                    <li class="active"><a href="#tab_1_1" data-toggle="tab">用户列表</a></li>
                                </if>
                                <!-- (标记)20160118 权限修复 -->
                                <if condition="checkAccess(CONTROLLER_NAME, 'group_save') OR checkAccess(CONTROLLER_NAME, 'group_edit')">
                                    <li class=""><a href="#tab_1_2" data-toggle="tab">用户组</a></li>
                                </if>
                            </ul>
                            <div class="tab-content">
                                <!-- (标记)20160118 权限修复 -->
                                <if condition="checkAccess(CONTROLLER_NAME, 'user_save') OR checkAccess(CONTROLLER_NAME, 'user_edit')">
                                    <div class="tab-pane row-fluid active" id="tab_1_1">
                                        <div class="row-fluid">
                                            <div class="span12 responsive" data-tablet="span12 fix-offset"
                                                 data-desktop="span12">
                                                <!-- BEGIN EXAMPLE TABLE PORTLET-->
                                                <div class="portlet">
                                                    <div class="portlet-title">
                                                        <div class="caption hidden"><i class="icon-cogs"></i>Table</div>
                                                        <!-- (标记)20160118 权限修复 -->
                                                        <if condition="checkAccess(CONTROLLER_NAME, 'user_save')">
                                                            <div class="actions">
                                                                <a href="{:U('Beusers/user_save')}" class="btn green"><iclass="icon-plus"></i> 添加</a>
                                                                <!--<a href="javascript:void(0)" class="btn yellow"><i class="icon-print"></i> 打印</a>-->
                                                            </div>
                                                        </if>
                                                    </div>
                                                    <div class="portlet-body">
                                                        <table class="table table-striped table-bordered table-hover" id="user_list">
                                                            <thead>
                                                            <tr>
                                                                <th>ID</th>
                                                                <th>用户名</th>
                                                                <th>姓名</th>
                                                                <th>用户组</th>
                                                                <th class="hidden-480">最后登录IP</th>
                                                                <th class="hidden-480">最后登录时间</th>
                                                                <!-- <th class="hidden-480">Email</th> -->
                                                                <th>状态</th>
                                                                <th>操作</th>
                                                            </tr>
                                                            </thead>
                                                            <tbody>
                                                            <tr class="odd gradeX">
                                                                <td colspan="8">加载中...</td>
                                                            </tr>
                                                            </tbody>
                                                        </table>
                                                    </div>
                                                </div>
                                                <!-- END EXAMPLE TABLE PORTLET-->
                                            </div>
                                        </div>
                                    </div>
                                </if>
                                <!-- (标记)20160118 权限修复 -->
                                <if condition="checkAccess(CONTROLLER_NAME, 'group_save') OR checkAccess(CONTROLLER_NAME, 'group_edit')">
                                    <div class="tab-pane row-fluid" id="tab_1_2">
                                        <div class="row-fluid">
                                            <div class="span12 responsive" data-tablet="span12 fix-offset"
                                                 data-desktop="span12">
                                                <!-- BEGIN EXAMPLE TABLE PORTLET-->
                                                <div class="portlet">
                                                    <div class="portlet-title">
                                                        <div class="caption hidden"><i class="icon-cogs"></i>Table</div>
                                                        <!-- (标记)20160118 权限修复 -->
                                                        <if condition="checkAccess(CONTROLLER_NAME, 'group_save')">
                                                            <div class="actions">
                                                                <a href="{:U('Beusers/group_save')}" class="btn green"><iclass="icon-plus"></i> 添加</a>
                                                                <!--<a href="javascript:void(0)" class="btn yellow"><iclass="icon-print"></i> 打印</a>-->
                                                            </div>
                                                        </if>
                                                    </div>
                                                    <div class="portlet-body">
                                                        <table class="table table-striped table-bordered table-hover" id="group_list">
                                                            <thead>
                                                            <tr>
                                                                <th>ID</th>
                                                                <th>标题</th>
                                                                <th class="hidden-480">描述</th>
                                                                <th>状态</th>
                                                                <th>操作</th>
                                                            </tr>
                                                            </thead>
                                                            <tbody>
                                                            <tr class="odd gradeX">
                                                                <td colspan="5">加载中...</td>
                                                            </tr>
                                                            </tbody>
                                                        </table>
                                                    </div>
                                                </div>
                                                <!-- END EXAMPLE TABLE PORTLET-->
                                            </div>
                                        </div>
                                    </div>
                                </if>
                            </div>
                        </div>
                        <!--END TABS-->
                    </form>
                </div>
            </div>
            <!-- END PAGE CONTENT-->
        </div>
        <!-- END PAGE CONTAINER-->
    </div>
    <!-- END PAGE -->
</div>
<!-- END CONTAINER -->

<include file="Public:footer"/>
<script type="text/javascript" src="__TMPL__Public/plugins/data-tables/jquery.dataTables.js"></script>
<script type="text/javascript" src="__TMPL__Public/plugins/data-tables/DT_bootstrap.js"></script>
<script type="text/javascript">
    jQuery(document).ready(function () {
        // begin: third table
        $('#user_list').dataTable({
            "bProcessing": true,
            "bServerSide": true,
            "sAjaxSource": "{:U('Beusers/index', array('cmd'=>'user_list'))}",
            "sServerMethod": "POST",
            "aaSorting": [
                [0, "desc"]
            ],
            "aLengthMenu": [
                [5, 15, 20],
                [5, 15, 20] // change per page values here
            ],
            // set the initial value
            "iDisplayLength": 5,
            "sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
            "sPaginationType": "bootstrap",
            "oLanguage": {
                "sInfo": "共 _TOTAL_ 条",
                "sLengthMenu": "_MENU_",
                "sSearch": "搜索:",
                "sZeroRecords": "查询无数据!",
                "sProcessing": "加载中...",
                "oPaginate": {
                    "sPrevious": "上一页",
                    "sNext": "下一页"
                }
            },
            "aoColumnDefs": [
                {
                    'bSortable': false,
                    'aTargets': [1, 2, 3, 4, 5, 6, 7]
                }
            ],
            "fnDrawCallback": function (oSettings) {
                jQuery('#user_list tbody tr').each(function () {
                    $(this).find('td:lt(6):gt(2)').addClass('hidden-480');
                });
                jQuery('.popovers').popover();
            }
        });
        jQuery('#user_list_wrapper .dataTables_filter input').addClass("m-wrap small"); // modify table search input
        jQuery('#user_list_wrapper .dataTables_length select').addClass("m-wrap small"); // modify table per page dropdown
        jQuery('#user_list_wrapper .dataTables_length select').select2(); // initialzie select2 dropdown

        //usergroup
        $('#group_list').dataTable({
            "bProcessing": true,
            "bServerSide": true,
            "sAjaxSource": "{:U('Beusers/index', array('cmd'=>'group_list'))}",
            "sServerMethod": "POST",
            "aaSorting": [
                [0, "desc"]
            ],
            "aLengthMenu": [
                [5, 15, 20],
                [5, 15, 20] // change per page values here
            ],
            // set the initial value
            "iDisplayLength": 5,
            "sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
            "sPaginationType": "bootstrap",
            "oLanguage": {
                "sInfo": "共 _TOTAL_ 条",
                "sLengthMenu": "_MENU_",
                "sSearch": "搜索:",
                "sZeroRecords": "查询无数据!",
                "sProcessing": "加载中...",
                "oPaginate": {
                    "sPrevious": "上一页",
                    "sNext": "下一页"
                }
            },
            "aoColumnDefs": [
                {
                    'bSortable': false,
                    'aTargets': [1, 2, 3, 4]
                }
            ],
            "fnDrawCallback": function (oSettings) {
                jQuery('#group_list tbody tr').each(function () {
                    $(this).find('td:lt(3):gt(1)').addClass('hidden-480');
                });
                jQuery('.popovers').popover();
            }
        });
        jQuery('#group_list_wrapper .dataTables_filter input').addClass("m-wrap small"); // modify table search input
        jQuery('#group_list_wrapper .dataTables_length select').addClass("m-wrap small"); // modify table per page dropdown
        jQuery('#group_list_wrapper .dataTables_length select').select2(); // initialzie select2 dropdown
    });
</script>
</body>
<!-- END BODY -->
</html>